package rim;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.OneToMany;

import datatypes.r2.basic.CD;
import datatypes.r2.basic.II;
import datatypes.r2.basic.ST;
import datatypes.r2.flavors.INT_NONNEG;
import datatypes.r2.flavors.SC_NT;
import datatypes.r2.foundation.DSET;

/**
 * Definition of Batch:
 * 
 * A message which is a collection of HL7 V3 messages.
 * 
 * 一条消息，这是一个集合的HL7 V3消息。
 * 
 * 
 * DesignComments:
 * 
 * Does the batch have any effect on the member message, or is it a composition
 * class that contains the member messages?
 * 
 * 该批次是否有任何成员消息的影响，或者是它的组成类包含成员的消息？
 * 
 * @author Obama
 * 
 */
public class Batch extends Transmission {
	/**
	 * Definition: The control identifier of the batch when it was originally
	 * transmitted.
	 * 
	 * 批次控制标识符当它最初被传染。
	 */
	private II referenceControlId;
	/**
	 * Definition: An identifier for the batch.
	 * 
	 * 一个批次的标识。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * This attribute is used by the application processing the batch.
	 * 
	 * 这个属性是用来处理批处理的应用程序。
	 */
	private SC_NT name;
	/**
	 * Definition: Comments related to the batch.
	 * 
	 * 一批相关的评论。
	 */
	private DSET<ST> batchComment;
	/**
	 * Definition: The count of individual transmissions contained within the
	 * batch, including nested batches.
	 * 
	 * 批处理内所载的个人传输，包括嵌套批次计数。
	 */
	private INT_NONNEG transmissionQuantity;
	/**
	 * Definition: The total number of messages in the batch.
	 * 
	 * 批次总数的消息。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * In cases of nested batches, batchTotalNumber is specific to the immediate
	 * batch, whereas transmissionQuantity sums all nested totals.
	 * 
	 * 在嵌套批次的情况下，batchTotalNumber是具体到眼前的一批，，而transmissionQuantity总结所有嵌套的总数。
	 * 
	 * 
	 * DesignComments:
	 * 
	 * Confirm differentiation from transmissionQuantity
	 * 
	 * 确认从transmissionQuantity分化
	 */
	private DSET<INT_NONNEG> batchTotalNumber;
	/**
	 * Definition: The type of content processing that the receiver of the batch
	 * is expected to undertake.
	 * 
	 * 批次接收预计进行内容处理的类型。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * Default value is sequential.
	 * 
	 * 默认值是连续的。
	 * 
	 * 
	 * Examples:
	 * 
	 * Sequential, unordered.
	 * 
	 * 连续的，无序的。
	 */
	private CD contentProcessingModeCode;
	@OneToMany
	private List<Transmission> transmission = new ArrayList<Transmission>();
}
